//
//  NSString+Trims.m
//  JQKit
//
//  Created by JQZ on 2017/12/27.
//  Copyright © 2017年 JQZ. All rights reserved.
//

#import "NSString+Trims.h"

@implementation NSString (Trims)

- (NSString *)stringByTrimmingWhitespace
{
    return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
}

- (NSString *)stringByTrimmingWhitespaceAndNewlines
{
    return [self stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
}

- (NSString *)stringByTrimmingAllWhitespace
{
    return [self stringByReplacingOccurrencesOfString:@" " withString:@""];
}

@end
